<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Yoha!</title>
		<link rel="stylesheet" href="/lib/ext/resources/css/ext.css">
		<script type="text/javascript" src="/lib/ext/ext-core-debug.js"></script>
		<script type="text/javascript">
			//启动类加载器，并设置跟目录
			Ext.Loader.setConfig({
				enabled:true,
				paths:{
					Ext:'/lib/ext/src',
					Microblogging:'/app'
				}
			});
			Ext.onReady(function(){
				//动态获取类文件  继承自panel的想要动态加载必须加载Ext.panel.Tool
				//好吧，谁让是预览版，BUG难免
				Ext.require(['Ext.panel.Tool','Ext.panel.Panel'],function(){
					Ext.fly('loading').remove();
					var panel = new Ext.panel.Panel({
						title:'this is for require test!',
						height:300,
						width:400,
						tbar:[{
							text:'test',
							handler:function(){
								Ext.require('Microblogging.Test',function(){
									var test = new Microblogging.Test();
									//好吧，不知道是bug不？必须先reset下才能获取默认值，晕死。
									test.resetName();
									alert(test.getName());
									test.alert();
								});
							}
						}],
						renderTo:Ext.getBody()
					});
				});
			});
		</script>
	</head>
	<body>
		<div id="loading">请稍等，正在加载文件.....</div>
	</body>
</html>